<?php
require("../inc/common.inc.php");
$VPPWIFISHANG="5";
$rentype=intval($rentype);
if ($rentype==1){
	$mobile=trim($mobile);
	$mac=trim($mac);
	$Rid=intval($Rid);
	//是否为空
	if($mobile=="" or $Rid==0 or $mac=="" or strlen($mac)!=12){echo "0";exit();}
	//验证来路
	$truepath=preg_replace("/(.+)\/([^\/]+)\/([^\/]+)/is","\\1",'http://'.$HTTP_HOST);
	if ($webdb[weburl]!=$truepath){echo "0";exit();}
	//验证手机号格式
	if(!eregi("^[0-9]{11,11}$",$mobile)){echo "0";exit();}
	$getcode=file_get_contents($VPPWIFIURL."wifirenzheng_mx.php?rentype=1&mobile=$mobile&mac=$mac&Rid=$Rid&shang={$VPPWIFISHANG}&sign=".md5($mac."{mx}".$VPPWIFISHANG."{z}".$mobile."{w}".$Rid));
	echo intval($getcode);
}
else{echo "0";}
?>
